﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

using Global.Class.Library;
using DataAccessLayer;
using DataAccessLayer.ERmgrVCPTableAdapters;


namespace BusinessLogicLayer
{
    public class CommonMetaList
    {

        public ERmgrVCP.ListSalesmenNameDataTable GetSalesmenName()
        {
            return GetSalesmenName(false);
        }

        public ERmgrVCP.ListSalesmenNameDataTable GetSalesmenName(bool withNewRow)
        {
            ListSalesmenNameTableAdapter listSalesmenNameTableAdapter = new ListSalesmenNameTableAdapter();
            ERmgrVCP.ListSalesmenNameDataTable listSalesmenNameDataTable = listSalesmenNameTableAdapter.GetData();

            if (withNewRow) listSalesmenNameDataTable.AddListSalesmenNameRow(0, "", "");
            return listSalesmenNameDataTable;
        }



        public ERmgrVCP.ListEmployeeMasterDataTable GetEmployeeMaster()
        {
            return GetEmployeeMaster(false);
        }

        public ERmgrVCP.ListEmployeeMasterDataTable GetEmployeeMaster(bool withNewRow)
        {
            ListEmployeeMasterTableAdapter listEmployeeMasterTableAdapter = new ListEmployeeMasterTableAdapter();
            ERmgrVCP.ListEmployeeMasterDataTable listEmployeeMasterDataTable = listEmployeeMasterTableAdapter.GetData();

            if (withNewRow) listEmployeeMasterDataTable.AddListEmployeeMasterRow(0, "", "", "", "");
            return listEmployeeMasterDataTable;
        }



        public ERmgrVCP.ListAddressAreaDataTable GetAddressArea()
        {
            return GetAddressArea(false);
        }

        public ERmgrVCP.ListAddressAreaDataTable GetAddressArea(bool withNewRow)
        {
            ListAddressAreaTableAdapter listAddressAreaTableAdapter = new ListAddressAreaTableAdapter();
            ERmgrVCP.ListAddressAreaDataTable listAddressAreaDataTable = listAddressAreaTableAdapter.GetData();

            if (withNewRow) listAddressAreaDataTable.AddListAddressAreaRow(0, "");
            return listAddressAreaDataTable;
        }


        public ERmgrVCP.ListItemCategoryDataTable GetItemCategory()
        {
            return GetItemCategory(false);
        }

        public ERmgrVCP.ListItemCategoryDataTable GetItemCategory(bool withNewRow)
        {
            ListItemCategoryTableAdapter listItemCategoryTableAdapter = new ListItemCategoryTableAdapter();
            ERmgrVCP.ListItemCategoryDataTable listItemCategoryDataTable = listItemCategoryTableAdapter.GetData();

            if (withNewRow) listItemCategoryDataTable.AddListItemCategoryRow(0, "");
            return listItemCategoryDataTable;
        }


        public ERmgrVCP.ListItemCommodityDataTable GetItemCommodity()
        {
            return GetItemCommodity(false);
        }

        public ERmgrVCP.ListItemCommodityDataTable GetItemCommodity(bool withNewRow)
        {
            ListItemCommodityTableAdapter listItemCommodityTableAdapter = new ListItemCommodityTableAdapter();
            ERmgrVCP.ListItemCommodityDataTable listItemCommodityDataTable = listItemCommodityTableAdapter.GetData();

            if (withNewRow) listItemCommodityDataTable.AddListItemCommodityRow(0, "", "");
            return listItemCommodityDataTable;
        }



        public ERmgrVCP.ListCustomerChannelDataTable GetCustomerChannel()
        {
            return GetCustomerChannel(false, false);
        }

        public ERmgrVCP.ListCustomerChannelDataTable GetCustomerChannel(bool withNewRow)
        {
            return GetCustomerChannel(withNewRow, false);
        }

        public ERmgrVCP.ListCustomerChannelDataTable GetCustomerChannel(bool withNewRow, bool primaryChannelOnly)
        {
            ListCustomerChannelTableAdapter listCustomerChannelTableAdapter = new ListCustomerChannelTableAdapter();
            ERmgrVCP.ListCustomerChannelDataTable listCustomerChannelDataTable;
            if (primaryChannelOnly)
                listCustomerChannelDataTable = listCustomerChannelTableAdapter.GetPrimaryChannel();
            else
                listCustomerChannelDataTable = listCustomerChannelTableAdapter.GetData();

            if (withNewRow) listCustomerChannelDataTable.AddListCustomerChannelRow(0, " ");
            return listCustomerChannelDataTable;
        }



        public ERmgrVCP.ListCustomerNameDataTable GetCustomerName()
        {
            return GetCustomerName(false);
        }

        public ERmgrVCP.ListCustomerNameDataTable GetCustomerName(bool withNewRow)
        {
            ListCustomerNameTableAdapter listCustomerNameTableAdapter = new ListCustomerNameTableAdapter();
            ERmgrVCP.ListCustomerNameDataTable listCustomerNameDataTable = listCustomerNameTableAdapter.GetData();

            if (withNewRow) listCustomerNameDataTable.AddListCustomerNameRow(0, " ", " ");
            return listCustomerNameDataTable;
        }


        public ERmgrVCP.ListWorkerNameDataTable GetWorkerName()
        {
            return GetWorkerName(false);
        }

        public ERmgrVCP.ListWorkerNameDataTable GetWorkerName(bool withNewRow)
        {
            ListWorkerNameTableAdapter listWorkerNameTableAdapter = new ListWorkerNameTableAdapter();
            ERmgrVCP.ListWorkerNameDataTable listWorkerNameDataTable = listWorkerNameTableAdapter.GetData();

            if (withNewRow) listWorkerNameDataTable.AddListWorkerNameRow(0, " ", " ");
            return listWorkerNameDataTable;
        }



        public ERmgrVCP.ListMaterialSetNameDataTable GetMaterialSetName()
        {
            return GetMaterialSetName(false);
        }

        public ERmgrVCP.ListMaterialSetNameDataTable GetMaterialSetName(bool withNewRow)
        {
            ListMaterialSetNameTableAdapter listMaterialSetNameTableAdapter = new ListMaterialSetNameTableAdapter();
            ERmgrVCP.ListMaterialSetNameDataTable listMaterialSetNameDataTable = listMaterialSetNameTableAdapter.GetData();

            if (withNewRow) listMaterialSetNameDataTable.AddListMaterialSetNameRow(0, " ", " ");
            return listMaterialSetNameDataTable;
        }


        public ERmgrVCP.ListMaterialSemiNameDataTable GetMaterialSemiName()
        {
            return GetMaterialSemiName(false);
        }

        public ERmgrVCP.ListMaterialSemiNameDataTable GetMaterialSemiName(bool withNewRow)
        {
            ListMaterialSemiNameTableAdapter listMaterialSemiNameTableAdapter = new ListMaterialSemiNameTableAdapter();
            ERmgrVCP.ListMaterialSemiNameDataTable listMaterialSemiNameDataTable = listMaterialSemiNameTableAdapter.GetData();

            if (withNewRow) listMaterialSemiNameDataTable.AddListMaterialSemiNameRow(0, " ", " ");
            return listMaterialSemiNameDataTable;
        }


        public ERmgrVCP.ListMarketingProgramGroupDataTable GetMarketingProgramGroup()
        {
            return GetMarketingProgramGroup(false);
        }

        public ERmgrVCP.ListMarketingProgramGroupDataTable GetMarketingProgramGroup(bool withNewRow)
        {
            ListMarketingProgramGroupTableAdapter listMarketingProgramGroupTableAdapter = new ListMarketingProgramGroupTableAdapter();
            ERmgrVCP.ListMarketingProgramGroupDataTable listMarketingProgramGroupDataTable = listMarketingProgramGroupTableAdapter.GetData();

            if (withNewRow) listMarketingProgramGroupDataTable.AddListMarketingProgramGroupRow(0, "");
            return listMarketingProgramGroupDataTable;
        }


        public ERmgrVCP.ListMarketingProgramTypeDataTable GetMarketingProgramType()
        {
            return GetMarketingProgramType(false);
        }

        public ERmgrVCP.ListMarketingProgramTypeDataTable GetMarketingProgramType(bool withNewRow)
        {
            ListMarketingProgramTypeTableAdapter listMarketingProgramTypeTableAdapter = new ListMarketingProgramTypeTableAdapter();
            ERmgrVCP.ListMarketingProgramTypeDataTable listMarketingProgramTypeDataTable = listMarketingProgramTypeTableAdapter.GetData();

            if (withNewRow) listMarketingProgramTypeDataTable.AddListMarketingProgramTypeRow(0, "");
            return listMarketingProgramTypeDataTable;
        }


        public ERmgrVCP.ListMarketingPaymentTypeDataTable GetMarketingPaymentType()
        {
            return GetMarketingPaymentType(false);
        }

        public ERmgrVCP.ListMarketingPaymentTypeDataTable GetMarketingPaymentType(bool withNewRow)
        {
            ListMarketingPaymentTypeTableAdapter listMarketingPaymentTypeTableAdapter = new ListMarketingPaymentTypeTableAdapter();
            ERmgrVCP.ListMarketingPaymentTypeDataTable listMarketingPaymentTypeDataTable = listMarketingPaymentTypeTableAdapter.GetData();

            if (withNewRow) listMarketingPaymentTypeDataTable.AddListMarketingPaymentTypeRow(0, "");
            return listMarketingPaymentTypeDataTable;
        }

        public ERmgrVCP.ListMarketingPaymentTermDataTable GetMarketingPaymentTerm()
        {
            return GetMarketingPaymentTerm(false);
        }

        public ERmgrVCP.ListMarketingPaymentTermDataTable GetMarketingPaymentTerm(bool withNewRow)
        {
            ListMarketingPaymentTermTableAdapter listMarketingPaymentTermTableAdapter = new ListMarketingPaymentTermTableAdapter();
            ERmgrVCP.ListMarketingPaymentTermDataTable listMarketingPaymentTermDataTable = listMarketingPaymentTermTableAdapter.GetData();

            if (withNewRow) listMarketingPaymentTermDataTable.AddListMarketingPaymentTermRow(0, "");
            return listMarketingPaymentTermDataTable;
        }



        public ERmgrVCP.ListGCGBCommandTypeDataTable GetGCGBCommandType()
        {
            return GetGCGBCommandType(false);
        }

        public ERmgrVCP.ListGCGBCommandTypeDataTable GetGCGBCommandType(bool withNewRow)
        {
            ListGCGBCommandTypeTableAdapter listGCGBCommandTypeTableAdapter = new ListGCGBCommandTypeTableAdapter();
            ERmgrVCP.ListGCGBCommandTypeDataTable listGCGBCommandTypeDataTable = listGCGBCommandTypeTableAdapter.GetData();

            if (withNewRow) listGCGBCommandTypeDataTable.AddListGCGBCommandTypeRow(0, "", "");
            return listGCGBCommandTypeDataTable;
        }


        public ERmgrVCP.ListItemTypeDataTable GetItemType()
        {
            return GetItemType(false);
        }

        public ERmgrVCP.ListItemTypeDataTable GetItemType(bool withNewRow)
        {
            ListItemTypeTableAdapter listItemTypeTableAdapter = new ListItemTypeTableAdapter();
            ERmgrVCP.ListItemTypeDataTable listItemTypeDataTable = listItemTypeTableAdapter.GetData();

            if (withNewRow) listItemTypeDataTable.AddListItemTypeRow(0, "");
            return listItemTypeDataTable;
        }

        public ERmgrVCP.ListTimeBaseDataTable GetTimeBase()
        {
            return GetTimeBase(false);
        }

        public ERmgrVCP.ListTimeBaseDataTable GetTimeBase(bool withNewRow)
        {
            ListTimeBaseTableAdapter listTimeBaseTableAdapter = new ListTimeBaseTableAdapter();
            ERmgrVCP.ListTimeBaseDataTable listTimeBaseDataTable = listTimeBaseTableAdapter.GetData();

            if (withNewRow) listTimeBaseDataTable.AddListTimeBaseRow(0, "");
            return listTimeBaseDataTable;
        }


        public ERmgrVCP.ListMechanicSchemeDataTable GetMechanicScheme()
        {
            return GetMechanicScheme(false);
        }

        public ERmgrVCP.ListMechanicSchemeDataTable GetMechanicScheme(bool withNewRow)
        {
            ListMechanicSchemeTableAdapter listMechanicSchemeTableAdapter = new ListMechanicSchemeTableAdapter();
            ERmgrVCP.ListMechanicSchemeDataTable listMechanicSchemeDataTable = listMechanicSchemeTableAdapter.GetData();

            if (withNewRow) listMechanicSchemeDataTable.AddListMechanicSchemeRow(0, "", "");
            return listMechanicSchemeDataTable;
        }


        public ERmgrVCP.MarketingProgramListDataTable GetMarketingProgramList()
        {
            return GetMarketingProgramList(false);
        }

        public ERmgrVCP.MarketingProgramListDataTable GetMarketingProgramList(bool withNewRow)
        {
            MarketingProgramListTableAdapter marketingProgramListTableAdapter = new MarketingProgramListTableAdapter();
            ERmgrVCP.MarketingProgramListDataTable marketingProgramListDataTable = marketingProgramListTableAdapter.GetData();

            if (withNewRow) marketingProgramListDataTable.AddMarketingProgramListRow(" ", " ", " ");
            return marketingProgramListDataTable;
        }


        public ERmgrVCP.MarketingIncentiveMasterListDataTable GetMarketingIncentiveMasterList()
        {
            return GetMarketingIncentiveMasterList(false);
        }

        public ERmgrVCP.MarketingIncentiveMasterListDataTable GetMarketingIncentiveMasterList(bool withNewRow)
        {
            MarketingIncentiveMasterListTableAdapter MarketingIncentiveMasterListTableAdapter = new MarketingIncentiveMasterListTableAdapter();
            ERmgrVCP.MarketingIncentiveMasterListDataTable MarketingIncentiveMasterListDataTable = MarketingIncentiveMasterListTableAdapter.GetData();

            if (withNewRow) MarketingIncentiveMasterListDataTable.AddMarketingIncentiveMasterListRow(0, DateTime.Today, " ");
            return MarketingIncentiveMasterListDataTable;
        }


        public ERmgrVCP.GCGBCommandMasterListDataTable GetGCGBCommandMasterList()
        {
            return GetGCGBCommandMasterList(false);
        }

        public ERmgrVCP.GCGBCommandMasterListDataTable GetGCGBCommandMasterList(bool withNewRow)
        {
            GCGBCommandMasterListTableAdapter gcgbCommandMasterListTableAdapter = new GCGBCommandMasterListTableAdapter();
            ERmgrVCP.GCGBCommandMasterListDataTable gcgbCommandMasterListDataTable = gcgbCommandMasterListTableAdapter.GetData();

            if (withNewRow) gcgbCommandMasterListDataTable.AddGCGBCommandMasterListRow("", Convert.ToDateTime("01/01/1900"));
            return gcgbCommandMasterListDataTable;
        }


        public ERmgrVCP.ListStockMaterialNameDataTable GetStockMaterialName()
        {
            return GetStockMaterialName(false);
        }

        public ERmgrVCP.ListStockMaterialNameDataTable GetStockMaterialName(bool withNewRow)
        {
            ListStockMaterialNameTableAdapter listStockMaterialNameTableAdapter = new ListStockMaterialNameTableAdapter();
            ERmgrVCP.ListStockMaterialNameDataTable listStockMaterialNameDataTable = listStockMaterialNameTableAdapter.GetData();

            if (withNewRow) listStockMaterialNameDataTable.AddListStockMaterialNameRow(0, " ", " ");
            return listStockMaterialNameDataTable;
        }

    }
}
